package cn.tedu.micro.demo.order.controller;

import cn.tedu.micro.demo.common.protocol.JsonResult;
import cn.tedu.micro.demo.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderController {
    /**
     * 请求参数 userId gunId
     * path /order/create
     * method POST
     * 返回 JsonResult<String>
     */
    @Autowired
    private OrderService orderService;
    @PostMapping("/order/create")
    public JsonResult<String> createOrder(Integer userId,Integer gunId){
        //控制层要什么 业务层返回什么
        String billId=orderService.createOrder(userId,gunId);
        return JsonResult.success(billId);
    }
}
